A Type System for Record Concatenation and Subtyping
نویسنده
چکیده
We deene an extension of a second-order type system with records, subtyping and record concatenation. This system can model the most important concepts of object-oriented languages. The novelty in our approach is that concatenation is only permitted if the types on common elds agree. We give examples of how object-oriented concepts can be modeled and show how the system can be translated to a type system without subtyping.
منابع مشابه
Type inference for record concatenation and subtyping
Record concatenation, multiple inheritance, and multiple-object cloning are closely related and part of various language designs. For example, in Cardelli’s untyped Obliq language, a new object can be constructed from several existing objects by cloning followed by concatenation; an error is given in case of field name conflicts. Type systems for record concatenation have been studied by Wand, ...
متن کاملType Inference and Principal Typings for Symmetric Record Concatenation and Mixin Modules
The obvious simple type system for a λ-calculus extended with recordconcatenation has a typability problem that was believed to be expensive,and which we prove NP-complete. Some previous approaches to this prob-lem employ subtyping polymorphism. We present Bowtie, a system of simpletypes for record concatenation which has principal typings, no subtyping, anda clean separatio...
متن کاملA Constraint-Based Presentation and Generalization of Rows
We study the combination of possibly conditional nonstructural subtyping constraints with rows. We give a new presentation of rows, where row terms disappear; instead, we annotate constraints with filters. We argue that, in the presence of subtyping, this approach is simpler and more general. In the case where filters are finite or cofinite sets of row labels, we give a constraint solving algor...
متن کاملType Inference for the Mixture of Matching and Implicit Subtyping
We present a type inference system for a language with object-oriented features such as polymorphic record access and subtyping. We separate the notion of matching and subtyping in order to avoid di culties caused by recursive type constraints. We will use two kinds of type constraints | record (variant) constraints and subtyping constraints. Then, we discuss simpli cation of such mixed type co...
متن کاملSubtyping Functional+Nonempty Record Types
Solving systems of subtype constraints (or subtype inequalities) is in the core of eecient type reconstruction in modern object-oriented languages with subtyping and inheritance, two problems known polynomial time equivalent. It is important to know how diierent combinations of type constructors innuence the complexity of the problem. We show the NP-hardness of the satissability problem for sub...
متن کامل